package com.abo.yaas.view;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.vaadin.Application;
import com.vaadin.terminal.StreamResource;

@SuppressWarnings("serial")
public class DynamicImageResource extends StreamResource {
    public DynamicImageResource(StreamSource streamSource,
            Application application) {
        super(streamSource, null, application);
        final SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        final String filename = "myfilename-" + df.format(new Date()) + ".png";
        setFilename(filename);
        setCacheTime(0l);
    }
}
